import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    port: 12489,
    // 支持跨域
    proxy: {
      '/api': {
        target: 'http://localhost:12489',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      } 
    }
  },
  // 支持跨域
  // 配置@别名
  resolve: {
    alias: {
      '@': '/src',
      '@view': "/src/views",
      '@apis': "/src/apis",
      "@/config": "/src/config"
    }
  }
})
